WHOOP HCI-capture extraction + CSV ground-truth correlation (#103)#133
Open
digitalerdude wants to merge 1 commit into
Open
WHOOP HCI-capture extraction + CSV ground-truth correlation (#103)#133digitalerdude wants to merge 1 commit into
digitalerdude wants to merge 1 commit into
Conversation
Two stdlib tools in Tools/linux-capture that turn a WHOOP data export into leverage for the un-decoded deep-record layouts tracked in ryanbr#103: - hci_extract.py: parse a phone Bluetooth HCI capture (iOS .pklg / Android btsnoop) of the official app, reassemble L2CAP/ATT, and emit the CRC-valid WHOOP frames as the project's capture.json. Only WHOOP streams reach the output. - correlate_ground_truth.py: known-plaintext field search. Cross-reference capture records against the official per-night values in a WHOOP CSV export (reusing the Swift importer's localized header aliases) to locate each biometric's byte offset + encoding. Distribution-overlap scoring (recall + precision) rejects constants and coincidences. Prints offsets only, so the output is safe to post on ryanbr#103 while health data stays local. Docs: new README sections + a ground-truth-correlation note in WHOOP5_DEEP_DATA.md. 25 new stdlib tests; full suite 129 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Nice! Could you write your PR in English? |
Author
|
Done - description is now in English. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two stdlib tools in
Tools/linux-capture/that turn a WHOOP data export into leverage for cracking the un-decoded deep-record layouts from #103 (type-0x2F, 5/MG history types — seedocs/WHOOP5_DEEP_DATA.md).Importing this CSV format is already fully solved (including localized DE/ES headers, #3). The remaining gap per #103 is the decoding — and a personal export is exactly the known-plaintext material needed for that.
Tools
hci_extract.py— parses a phone Bluetooth HCI capture of the official app (iOS.pklg/ Androidbtsnoop_hci.log), reassembles L2CAP/ATT, and emits the CRC-valid WHOOP frames in the project's owncapture.jsonformat. Only WHOOP streams make it into the output (other devices' frames are dropped). App writes are captured too, taggeddir:tx(the enable sequence).correlate_ground_truth.py— known-plaintext field search. Cross-references capture records against the official per-night values from a WHOOP CSV export (HRV, resting HR, skin temperature, SpO₂, respiratory rate) and finds the byte offset + encoding + scale for each biometric. The localized header aliases are mirrored from the Swift importer (CSVParsing.swift). Distribution-overlap scoring (recall + precision) rejects constants and coincidental matches.Privacy
Both tools run locally;
correlateoutputs only offsets/encodings, never health values. This lets 5/MG owners contribute a confirmed field mapping on #103 without posting their capture or data export.Verification
hci_extract(331 type-47 frames) →correlaterecovers resting HR (offset 10, u8) and skin temperature (offset 14, float32) exactly.Mapped offsets still follow the project rule — real captures, never invented offsets — before landing in
parseFrameWhoop5/whoop_protocol.json.🤖 Generated with Claude Code